﻿using SolidWorks.Interop.sldworks;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MechAddin.Common
{
    internal static class ThisModelDoc2
    {
        public static void DeleteMate(this ModelDoc2 swDoc,Component2 comp)
        {
            if (swDoc == null) { return; }
            if (comp == null) { return; }
            var mates=comp.GetMates();
            if (mates==null)
            {
                return;
            }
            swDoc.ClearSelection2(true);
            foreach (var m in mates)
            {
                Feature fea=m as Feature;
                fea?.Select2(true, -1);
            }
            swDoc.EditDelete();
            swDoc.EditRebuild3();


        }


    }
}
